/*
Copyright (c) 2025 HeZongLun
NahidaProject is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan
PSL v2.
You may obtain a copy of Mulan PSL v2 at:
		 http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
See the Mulan PSL v2 for more details.
*/

#pragma once

#ifdef _WIN32
#define ExportSymbol  __declspec(dllexport)
#else
#define ExportSymbol
#endif

#include <iostream>
#include <iomanip>
#include <vector>

namespace NahidaProject {

	class ExportSymbol TablePrint {
	private:
		std::vector<std::string> column_content;
		std::vector<int> column_size;
		std::vector<std::vector<std::string>> record;
	public:
		TablePrint() {

		}

		TablePrint(std::vector<std::string> cc, std::vector<int> cs, std::vector<std::vector<std::string>> rc) {
			column_content = cc;
			column_size = cs;
			record = rc;
		}

		TablePrint(std::vector<std::string> cc, std::vector<std::vector<std::string>> rc) {
			int cols = (int)cc.size(), rows = (int)rc.size();

			for (int col = 0; col < cols; col++) {
				int max = (int)cc[col].size();
				for (int row = 0; row < rows; row++) {
					max = (int)rc[row][col].size() > max ? rc[row][col].size() : max;
				}
				column_size.push_back(max);
			}
			column_content = cc;
			record = rc;

		}

		void PrintTable();
	};
}
